
#ifndef __SECURITY_TOKEN_FILE_H
#define __SECURITY_TOKEN_FILE_H

#include "SecurityToken.h"

/** A security token based on a key (possibly encrypted) in a local
 * file. */
class SecurityTokenFile : public SecurityToken
{
   public:
      SecurityTokenFile(const char *ifilename, const char *ipassword);
      virtual ~SecurityTokenFile();
      int authenticateSSHSession(LIBSSH2_SESSION *tsession, const char *username);
      virtual sshauthtype getAuthenticationType() { return SSH_AUTH_TYPE_KEY; }
      virtual int wasTried() { return tried; }
   private:
      /** Name of the file containing the key. */
      char *filename;
      /** Password for the encrypted key in the file. */
      char *password;
};

#endif
